1 <md-dialog class="action-dialog" aria-label="New Action">
2 <form name="actionForm" class="md-inline-form" novalidate>
3 <md-toolbar class="md-accent md-hue-2">
5 class="md-toolbar-tools"
7 layout-align="space-between center"
10 >{{ vm.newAction ? 'TOOLS.NEW_ACTION' : 'TOOLS.EDIT_ACTION' |
13 <md-button class="md-icon-button" ng-click="vm.closeDialog()">
15 md-font-icon="icon-close"
16 aria-label="Close dialog"
21 <md-dialog-content ms-scroll>
22 <md-input-container class="md-block">
23 <label translate="TOOLS.ACTION">Action</label>
26 ng-model="vm.action.action"
27 ng-init="vm.onActionInit()"
28 ng-change="vm.onActionSelection()"
31 ng-disabled="!vm.newAction"
34 ng-value="'contactManager'"
35 ng-if="vm.trigger.channel == 'voice'"
37 {{ 'TOOLS.CONTACT_MANAGER' | translate }}
40 ng-value="'integration'"
41 ng-if="vm.trigger.channel == 'voice' && ((vm.newAction && vm.hasIntegrationsPermissions) || !vm.newAction)"
43 {{ 'TOOLS.INTEGRATIONS' | translate }}
45 <md-option ng-value="'motionbar'">
46 {{ 'TOOLS.MOTIONBAR' | translate }}
48 <md-option ng-value="'jscripty'">
49 {{ 'TOOLS.JSCRIPTY' | translate }}
51 <md-option ng-value="'urlForward'">
52 {{ 'TOOLS.URL_FORWARD' | translate }}
54 <md-option ng-value="'browser'">
55 {{ 'TOOLS.BROWSER' | translate }}
57 <md-option ng-value="'bot'" ng-if="vm.trigger.channel == 'voice'">
58 {{ 'TOOLS.BOT' | translate }}
60 <md-option ng-value="'script'">
61 {{ 'TOOLS.SCRIPT' | translate }}
65 ng-messages="actionForm['action'].$error"
66 ng-show="actionForm['action'].$touched"
69 <div ng-message="required">
70 <span translate="TOOLS.ERRORS.ACTION_REQUIRED"
71 >Action field is required</span
77 ng-if="vm.action.action == 'jscripty'"
80 <label translate="TOOLS.PROJECT">Project</label>
81 <md-select name="data1" ng-model="vm.action.data1" required>
83 ng-value="''+data1.id"
84 ng-repeat="data1 in vm.projects"
85 ng-disabled="data1.canSelect === false"
87 {{ data1.name }}</md-option
91 ng-messages="actionForm['data1'].$error"
92 ng-show="actionForm['data1'].$touched"
95 <div ng-message="required">
96 <span translate="TOOLS.ERRORS.PROJECT_REQUIRED"
97 >Project field is required</span
101 </md-input-container>
103 ng-if="vm.action.action == 'browser'"
106 <label translate="TOOLS.TYPE">Type</label>
109 ng-model="vm.action.data1"
110 ng-change="vm.onTypeSelection()"
113 <md-option ng-value="'0'">Popup</md-option>
114 <md-option ng-value="'1'">CTI URL</md-option>
117 ng-messages="actionForm['data1'].$error"
118 ng-show="actionForm['data1'].$touched"
121 <div ng-message="required">
122 <span translate="TOOLS.ERRORS.TYPE_REQUIRED"
123 >Type field is required</span
127 </md-input-container>
129 ng-if="vm.action.action == 'contactManager'"
132 <label translate="TOOLS.LIST">List</label>
135 ng-model="vm.action.data1"
136 ng-change="vm.onListSelection()"
140 ng-value="''+data1.id"
141 ng-repeat="data1 in vm.lists"
142 ng-disabled="data1.canSelect === false"
144 {{ data1.name }}</md-option
148 ng-messages="actionForm['data1'].$error"
149 ng-show="actionForm['data1'].$touched"
152 <div ng-message="required">
153 <span translate="TOOLS.ERRORS.LIST_REQUIRED"
154 >List field is required</span
158 </md-input-container>
160 ng-if="vm.action.action == 'contactManager'"
163 <label translate="TOOLS.SEARCH_FIELDS">Search fields</label>
166 ng-model="vm.action.data3"
167 ng-init="vm.onSearchFieldsInit()"
171 <md-optgroup label="{{ 'TOOLS.STANDARD' | translate }}">
173 ng-value="field.columnName"
174 ng-repeat="field in vm.contactFields"
176 {{ field.displayName }}</md-option
180 label="{{ 'TOOLS.LIST' | translate }}"
181 ng-if="vm.listFields.length > 0"
184 ng-value="field.columnName"
185 ng-repeat="field in vm.listFields"
187 {{ field.name }}</md-option
191 label="{{ 'TOOLS.GLOBALS' | translate }}"
192 ng-if="vm.customFields.length > 0"
195 ng-value="field.columnName"
196 ng-repeat="field in vm.customFields"
198 {{ field.displayName }}</md-option
203 ng-messages="actionForm['data3'].$error"
204 ng-show="actionForm['data3'].$touched"
207 <div ng-message="required">
208 <span translate="TOOLS.ERRORS.SEARCH_FIELDS_REQUIRED"
209 >Search fields field is required</span
213 </md-input-container>
215 ng-if="vm.action.action == 'contactManager'"
218 <label translate="TOOLS.AUTOCREATECONTACT"
219 >Create contact automatically</label
223 ng-model="vm.action.data2"
224 ng-change="vm.onAutocreateSelection()"
227 <md-option ng-value="'1'"> {{ 'TOOLS.YES' | translate }} </md-option>
228 <md-option ng-value="'0'"> {{ 'TOOLS.NO' | translate }} </md-option>
231 ng-messages="actionForm['data2'].$error"
232 ng-show="actionForm['data2'].$touched"
235 <div ng-message="required">
236 <span translate="TOOLS.ERRORS.AUTOCREATECONTACT_REQUIRED"
237 >AutoCreateContact field is required</span
241 </md-input-container>
243 ng-if="vm.action.action == 'contactManager' && vm.action.data2 === '1'"
246 <label translate="TOOLS.AUTOCREATE_FIELD">Autocreate field</label>
248 name="autocreateField"
249 ng-model="vm.action.data4"
250 ng-required="vm.action.data2 === '1'"
252 <md-optgroup label="{{ 'TOOLS.STANDARD' | translate }}">
254 ng-value="field.columnName"
255 ng-repeat="field in vm.contactFields"
257 {{ field.displayName }}</md-option
261 label="{{ 'TOOLS.LIST' | translate }}"
262 ng-if="vm.listFields.length > 0"
265 ng-value="field.columnName"
266 ng-repeat="field in vm.listFields"
268 {{ field.name }}</md-option
272 label="{{ 'TOOLS.GLOBALS' | translate }}"
273 ng-if="vm.customFields.length > 0"
276 ng-value="field.columnName"
277 ng-repeat="field in vm.customFields"
279 {{ field.displayName }}</md-option
284 ng-messages="actionForm['data4'].$error"
285 ng-show="actionForm['data4'].$touched"
288 <div ng-message="required">
289 <span translate="TOOLS.ERRORS.AUTOCREATE_FIELD_REQUIRED"
290 >Autocreate field is required</span
294 </md-input-container>
296 ng-if="vm.action.action == 'urlForward'"
299 <label translate="TOOLS.TYPE">Type</label>
300 <md-select name="data1" ng-model="vm.action.data1" required>
301 <md-option ng-value="'GET'">GET</md-option>
302 <md-option ng-value="'POST'">POST</md-option>
303 <md-option ng-value="'PUT'">PUT</md-option>
304 <md-option ng-value="'DELETE'">DELETE</md-option>
307 ng-messages="actionForm['data1'].$error"
308 ng-show="actionForm['data1'].$touched"
311 <div ng-message="required">
312 <span translate="TOOLS.ERRORS.TYPE_REQUIRED"
313 >Type field is required</span
317 </md-input-container>
319 ng-if="vm.action.action == 'urlForward'"
322 <label translate="TOOLS.URL">Url</label>
326 ng-model="vm.action.data2"
330 ng-messages="actionForm['data2'].$error"
331 ng-show="actionForm['data2'].$touched"
334 <div ng-message="required">
335 <span translate="TOOLS.ERRORS.URL_REQUIRED"
336 >Url field is required</span
339 <div ng-message="url">
340 <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL"
341 >Url must be a valid url http://www.xcally.com</span
345 </md-input-container>
347 ng-if="vm.action.action == 'urlForward'"
350 <label translate="TOOLS.TIMEOUT">Timeout</label>
354 ng-model="vm.action.data5"
359 <div class="hint"><span translate="TOOLS.HELP.TIMEOUT"></span></div>
361 ng-messages="actionForm['data5'].$error"
362 ng-show="actionForm['data5'].$touched"
365 <div ng-message="required">
366 <span translate="TOOLS.ERRORS.TIMEOUT_REQUIRED"
367 >Timeout field is required</span
370 <div ng-message="min">
372 translate="TOOLS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO"
373 >Timeout must be a valid greater or equal than</span
377 <div ng-message="max">
378 <span translate="TOOLS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO"
379 >Timeout must be a valid greater or equal than</span
384 </md-input-container>
386 ng-if="vm.action.action == 'urlForward'"
389 <label translate="TOOLS.HEADERS">Headers</label>
390 <textarea name="data6" ng-model="vm.action.data6"></textarea>
391 <div class="hint"><span translate="TOOLS.HELP.HEADERS"></span></div>
392 </md-input-container>
394 ng-if="vm.action.action == 'urlForward' && (vm.action.data1 == 'POST' || vm.action.data1 == 'PUT')"
397 <label translate="TOOLS.BODY">Body</label>
398 <textarea name="data7" ng-model="vm.action.data7"></textarea>
399 <div class="hint"><span translate="TOOLS.HELP.BODY"></span></div>
400 </md-input-container>
401 <md-input-container ng-if="vm.action.action == 'script'" class="md-block">
402 <label translate="TOOLS.SCRIPT_TYPE">Script_Type</label>
403 <input type="input" name="data2" ng-model="vm.action.data2" />
404 <div class="hint"><span translate="TOOLS.HELP.SCRIPT_TYPE"></span></div>
406 ng-messages="actionForm['data2'].$error"
407 ng-show="actionForm['data2'].$touched"
410 <div ng-message="required">
411 <span translate="TOOLS.ERRORS.SCRIPT_TYPE_REQUIRED"
412 >Script_Type field is required</span
416 </md-input-container>
417 <md-input-container ng-if="vm.action.action == 'script'" class="md-block">
418 <label translate="TOOLS.SCRIPT_INFO">Script_Info</label>
419 <input type="input" name="data1" ng-model="vm.action.data1" />
420 <div class="hint"><span translate="TOOLS.HELP.SCRIPT_INFO"></span></div>
422 ng-messages="actionForm['data1'].$error"
423 ng-show="actionForm['data1'].$touched"
426 <div ng-message="required">
427 <span translate="TOOLS.ERRORS.SCRIPT_INFO_REQUIRED"
428 >Script_Info field is required</span
432 </md-input-container>
433 <md-input-container ng-if="vm.action.action == 'script'" class="md-block">
434 <label translate="TOOLS.SCRIPT">Script</label>
435 <textarea name="data3" ng-model="vm.action.data3" required></textarea>
436 <div class="hint"><span translate="TOOLS.HELP.SCRIPT"></span></div>
438 ng-messages="actionForm['data3'].$error"
439 ng-show="actionForm['data3'].$touched"
442 <div ng-message="required">
443 <span translate="TOOLS.ERRORS.SCRIPT_REQUIRED"
444 >Script field is required</span
448 </md-input-container>
450 ng-if="vm.action.action == 'integration'"
453 <label translate="TOOLS.INTEGRATION">Integration</label>
456 ng-model="vm.action.data1"
457 ng-init="vm.onIntegrationInit()"
458 ng-change="vm.onIntegrationSelection()"
463 ng-if="(vm.newAction && vm.hasSectionPermissions[1301]) || !vm.newAction"
464 ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1301])"
468 ng-value="'salesforce'"
469 ng-if="(vm.newAction && vm.hasSectionPermissions[1302]) || !vm.newAction"
470 ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1302])"
471 >Salesforce</md-option
474 ng-value="'sugarcrm'"
475 ng-if="(vm.newAction && vm.hasSectionPermissions[1305]) || !vm.newAction"
476 ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1305])"
480 ng-value="'freshdesk'"
481 ng-if="(vm.newAction && vm.hasSectionPermissions[1303]) || !vm.newAction"
482 ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1303])"
483 >Freshdesk</md-option
487 ng-if="(vm.newAction && vm.hasSectionPermissions[1306]) || !vm.newAction"
488 ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1306])"
493 ng-if="(vm.newAction && vm.hasSectionPermissions[1307]) || !vm.newAction"
494 ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1307])"
499 ng-if="(vm.newAction && vm.hasSectionPermissions[1308]) || !vm.newAction"
500 ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1308])"
504 ng-value="'dynamics365'"
505 ng-if="(vm.newAction && vm.hasSectionPermissions[1309]) || !vm.newAction"
506 ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1309])"
507 >Dynamics365</md-option
510 ng-value="'servicenow'"
511 ng-if="(vm.newAction && vm.hasSectionPermissions[1310]) || !vm.newAction"
512 ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1310])"
513 >ServiceNow</md-option
516 ng-value="'freshsales'"
517 ng-if="(vm.newAction && vm.hasSectionPermissions[1311]) || !vm.newAction"
518 ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1311])"
519 >Freshsales</md-option
523 ng-messages="actionForm['data1'].$error"
524 ng-show="actionForm['data1'].$touched"
527 <div ng-message="required">
528 <span translate="TOOLS.ERRORS.INTEGRATION_REQUIRED"
529 >Integration field is required</span
533 </md-input-container>
535 ng-if="vm.action.action == 'integration' && vm.action.data1"
538 <label translate="TOOLS.ACCOUNT">Account</label>
541 ng-model="vm.action.data2"
542 ng-change="vm.onIntegrationAccountSelection()"
543 ng-disabled="vm.action.isIntegrationDisabled"
546 <md-option ng-value="''+data2.id" ng-repeat="data2 in vm.accounts"
547 >{{ data2.name }}</md-option
551 ng-messages="actionForm['data2'].$error"
552 ng-show="actionForm['data2'].$touched"
555 <div ng-message="required">
556 <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED"
557 >Account field is required</span
561 </md-input-container>
563 ng-if="vm.action.action == 'integration' && vm.action.data1 && vm.action.data2"
566 <label translate="TOOLS.CONFIGURATION">Configuration</label>
569 ng-model="vm.action.data3"
571 ng-disabled="vm.action.isIntegrationDisabled"
574 ng-value="''+data3.id"
575 ng-repeat="data3 in vm.configurations | filter:{ AccountId:vm.action.data2 }"
576 >{{ data3.name }}</md-option
580 ng-messages="actionForm['data3'].$error"
581 ng-show="actionForm['data3'].$touched"
584 <div ng-message="required">
585 <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED"
586 >Configuration field is required</span
590 </md-input-container>
592 ng-if="vm.action.action == 'motionbar'"
595 <label translate="TOOLS.TYPE">Type</label>
598 ng-model="vm.action.data1"
599 ng-change="vm.onTypeSelection()"
602 <md-option ng-value="'0'">Popup</md-option>
603 <md-option ng-value="'1'">CTI URL</md-option>
604 <md-option ng-value="'2'">Windows App</md-option>
607 ng-messages="actionForm['data1'].$error"
608 ng-show="actionForm['data1'].$touched"
611 <div ng-message="required">
612 <span translate="TOOLS.ERRORS.TYPE_REQUIRED"
613 >Type field is required</span
617 </md-input-container>
619 ng-if="vm.action.action == 'motionbar' && vm.action.data1 == '1'"
622 <label translate="TOOLS.URL">Url</label>
626 ng-model="vm.action.data2"
630 ng-messages="actionForm['data2'].$error"
631 ng-show="actionForm['data2'].$touched"
634 <div ng-message="required">
635 <span translate="TOOLS.ERRORS.URL_REQUIRED"
636 >Url field is required</span
639 <div ng-message="url">
640 <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL"
641 >Url must be a valid url http://www.xcally.com</span
645 </md-input-container>
647 ng-if="vm.action.action == 'motionbar' && vm.action.data1 == '2'"
650 <label translate="TOOLS.APPLICATION">Application</label>
654 ng-model="vm.action.data2"
658 ng-messages="actionForm['data2'].$error"
659 ng-show="actionForm['data2'].$touched"
662 <div ng-message="required">
663 <span translate="TOOLS.ERRORS.APPLICATION_REQUIRED"
664 >Application field is required</span
668 </md-input-container>
670 ng-if="vm.action.action == 'motionbar' && vm.action.data1 == '2'"
673 <label translate="TOOLS.ARGUMENTS">Arguments</label>
674 <input type="text" name="data3" ng-model="vm.action.data3" />
676 ng-messages="actionForm['data3'].$error"
677 ng-show="actionForm['data3'].$touched"
680 <div ng-message="required">
681 <span translate="TOOLS.ERRORS.ARGUMENTS_REQUIRED"
682 >Arguments field is required</span
686 </md-input-container>
688 ng-if="vm.action.action == 'motionbar' && vm.action.data1 == '0'"
691 <label translate="TOOLS.TEMPLATE">Template</label>
692 <md-select name="data2" ng-model="vm.action.data2" required>
694 ng-value="''+data2.id"
695 ng-repeat="data2 in vm.templates"
696 ng-disabled="data2.canSelect === false"
698 {{ data2.name }}</md-option
702 ng-messages="actionForm['data2'].$error"
703 ng-show="actionForm['data2'].$touched"
706 <div ng-message="required">
707 <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED"
708 >Template field is required</span
712 </md-input-container>
714 ng-if="vm.action.action == 'browser' && vm.action.data1 == '0'"
717 <label translate="TOOLS.TEMPLATE">Template</label>
718 <md-select name="data2" ng-model="vm.action.data2" required>
720 ng-value="''+data2.id"
721 ng-repeat="data2 in vm.templates"
722 ng-disabled="data2.canSelect === false"
724 {{ data2.name }}</md-option
728 ng-messages="actionForm['data2'].$error"
729 ng-show="actionForm['data2'].$touched"
732 <div ng-message="required">
733 <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED"
734 >Template field is required</span
738 </md-input-container>
740 ng-if="vm.action.action == 'browser' && vm.action.data1 == '1'"
743 <label translate="TOOLS.URL">Url</label>
747 ng-model="vm.action.data2"
751 ng-messages="actionForm['data2'].$error"
752 ng-show="actionForm['data2'].$touched"
755 <div ng-message="required">
756 <span translate="TOOLS.ERRORS.URL_REQUIRED"
757 >Url field is required</span
760 <div ng-message="url">
761 <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL"
762 >Url must be a valid url http://www.xcally.com</span
766 </md-input-container>
768 ng-if="(vm.action.action == 'motionbar' || vm.action.action == 'browser') && vm.action.data1 == '1'"
771 <label translate="TOOLS.EVENTVARIABLES">EventVariables</label>
772 <md-select name="data3" ng-model="vm.action.data3" required>
773 <md-option ng-value="'1'"> {{ 'TOOLS.YES' | translate }} </md-option>
774 <md-option ng-value="'0'"> {{ 'TOOLS.NO' | translate }} </md-option>
777 <span translate="TOOLS.HELP.EVENTVARIABLES"></span>
780 ng-messages="actionForm['data3'].$error"
781 ng-show="actionForm['data3'].$touched"
784 <div ng-message="required">
785 <span translate="TOOLS.ERRORS.EVENTVARIABLES_REQUIRED"
786 >EventVariables field is required</span
790 </md-input-container>
792 ng-if="vm.action.action == 'browser' && vm.action.data1 == '1'"
795 <label translate="TOOLS.LOCATION">Location</label>
796 <md-select name="data4" ng-model="vm.action.data4" required>
797 <md-option ng-value="'0'" ng-selected="true">
798 {{ 'TOOLS.NEW_TAB' | translate }}
800 <md-option ng-value="'1'">
801 {{ 'TOOLS.NEW_WINDOW' | translate }}
803 <md-option ng-value="'2'">
804 {{ 'TOOLS.MOTION_TAB' | translate }}
808 ng-messages="actionForm['data4'].$error"
809 ng-show="actionForm['data4'].$touched"
812 <div ng-message="required">
813 <span translate="TOOLS.ERRORS.LOCATION_REQUIRED"
814 >Location field is required</span
818 </md-input-container>
820 ng-if="vm.action.action == 'browser' && vm.action.data4 == '1'"
823 <label translate="TOOLS.WINDOWWIDTH">WindowWidth</label>
824 <input type="text" name="data5" ng-model="vm.action.data5" />
826 ng-messages="actionForm['data5'].$error"
827 ng-show="actionForm['data5'].$touched"
830 <div ng-message="required">
831 <span translate="TOOLS.ERRORS.WINDOWWIDTH_REQUIRED"
832 >WindowWidth field is required</span
836 </md-input-container>
838 ng-if="vm.action.action == 'browser' && vm.action.data4 == '1'"
841 <label translate="TOOLS.WINDOWHEIGHT">WindowHeight</label>
842 <input type="text" name="data6" ng-model="vm.action.data6" />
844 ng-messages="actionForm['data6'].$error"
845 ng-show="actionForm['data6'].$touched"
848 <div ng-message="required">
849 <span translate="TOOLS.ERRORS.WINDOWHEIGHT_REQUIRED"
850 >WindowHeight field is required</span
854 </md-input-container>
855 <div class="error-list">
857 ng-repeat="error in vm.errors"
860 layout-align="space-between center"
863 <span class="message">{{error.message}}</span>
864 <span class="type">({{error.type}})</span>
866 <md-button class="md-icon-button">
868 md-font-icon="icon-alert-box"
869 aria-label="alert error"
878 layout-align="space-between center"
879 ng-if="!vm.crudPermissions.readOnly"
881 <div layout="row" layout-align="start center">
884 ng-if="vm.crudPermissions.canEdit && !vm.newAction"
885 ng-click="vm.saveAction()"
886 class="send-button md-accent md-raised"
887 ng-disabled="actionForm.$invalid || actionForm.$pristine"
889 translate="TOOLS.SAVE"
890 translate-attr-aria-label="TOOLS.SAVE"
896 ng-if="vm.crudPermissions.canEdit && vm.newAction"
897 ng-click="vm.addNewAction()"
898 class="send-button md-accent md-raised"
899 ng-disabled="actionForm.$invalid"
901 translate="TOOLS.ADD_ACTION"
902 translate-attr-aria-label="TOOLS.ADD_ACTION"
909 class="md-icon-button"
910 ng-if="vm.crudPermissions.canDelete && !vm.newAction"
911 ng-click="vm.deleteAction($event)"
914 translate-attr-aria-label="TOOLS.DELETE"
916 <md-icon md-font-icon="icon-delete"></md-icon>
917 <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>